﻿@model IEnumerable<DAL.Article>
@{
    ViewBag.Title = "Search";
}

<div class="container">
    <h2>@ViewBag.Message</h2>
    <h3>Mot-clef : @ViewBag.search</h3>
    <br /><br />

    @if (Model.Count() > 0)
    {
        foreach (DAL.Article article in Model)
        {
            <h3><a href="/Articles/Details/@article.ID">@article.Title</a> [ <a href="/Categories/Details/@article.Category.ID" id="@article.ID" rel="popover" data-content="@article.Category.Description" data-original-title="Description"> @article.Category.Name </a> ]</h3><br />
            <div class="well"><strong>@article.Content</strong></div>
    
            <p>
                <link rel="canonical" href="/Articles/Details/@article.ID" />
                <g:plusone size="medium"></g:plusone>
                <a href="/Articles/Details/@article.ID" class="twitter-share-button" data-lang="fr">Tweet</a>
                <fb:like href="/Articles/Details/@article.ID" send="false" layout="button_count" width="450" show_faces="false"></fb:like>
            </p><br />
        
            <script src="@Url.Content("~/Scripts/bootstrap-transition.js")" type="text/javascript"></script>
            <script src="@Url.Content("~/Scripts/jquery.js")" type="text/javascript"></script>
            <script src="@Url.Content("~/Scripts/bootstrap-tooltip.js")" type="text/javascript"></script>
            <script src="@Url.Content("~/Scripts/bootstrap-popover.js")" type="text/javascript"></script>

            <script type="text/javascript">
                $(function () {
                    $("#@article.ID").popover({ placement: 'right' });
                });  
            </script> 
        }
    }
    else
    {
        <div class="alert alert-danger">
            <strong>Erreur!</strong> Aucun résultat ne correspond à votre recherche.
        </div>
        <script src="@Url.Content("~/Scripts/bootstrap-alert.js")" type="text/javascript"></script>
    }
</div>